import React from 'react';
import { View, TextInput } from 'react-native';

function UselessTextInput(props) {
	return (
		<TextInput
    {...props} // 将父组件传递来的所有props传递给TextInput;比如下面的multiline和numberOfLines
    editable
    maxLength={40}
		/>
	);
}

const TextInputPage = ()=> {
	const [value, onChangeText] = React.useState('Useless Multiline Placeholder');

	// 你可以试着输入一种颜色，比如red，那么这个red就会作用到View的背景色样式上
	return (
		<View
    style={{
				backgroundColor: value,
				borderBottomColor: '#000000',
				borderBottomWidth: 1
			}}
		>
			<UselessTextInput
    multiline
    numberOfLines={4}
    onChangeText={text => onChangeText(text)}
    value={value}
			/>
		</View>
	);
};

export default TextInputPage;
